<script lang="ts" setup>
import { useUserStore } from "@/store/modules/user";
import { getOSSURL } from "@/utils/utils";

const userStore = useUserStore();

const bgImg = getOSSURL(`imgs/h5-others/客服背景/bg.png`);

const kfMap = {
  // 成功
  "1699754050142015488": [
    {
      name: "客服1",
      kfid: "kfc25f79c5fbb78384b",
    },
    {
      name: "客服2",
      kfid: "kfcba7d0ef943f52189",
    },
  ],
  // 交通
  "1713818634011238401": [
    {
      name:"客服1",
      kfid:"kfcb3449732868c67ea"
    },
    {
      name:"客服2",
      kfid:"kfc850d88a72816101a"
    }
  ],
};

// @ts-ignore
const kfList = kfMap[userStore.tenantInfo.id]

const openCustomerService = (kfid: string) => {
  window.open(`https://work.weixin.qq.com/kfid/${kfid}`);
};
</script>

<template>
  <div class="h-screen flex flex-col">
    <div class="grow bg-gray-1 of-y-auto">
      <img class="h-full w-full object-cover" :src="bgImg" />
    </div>
    <ul class="shrink-0 flex p-3 pb-5 gap-3">
      <li v-for="item in kfList" :key="item.kfid" class="grow py-2 text-center bg-blue-5 c-white rd-1" @click="openCustomerService(item.kfid)">
        {{ item.name }}
      </li>
    </ul>
  </div>
</template>
